<!--
 * @name: 
 * @Author: 刘大可
 * @Date: 2023-07-26 17:12:51
 * @LastEditors: 刘大可
 * @LastEditTime: 2023-07-28 11:26:43
-->
<template>
  	<div class="index">
		<uni-nav-bar @clickLeft	="back" leftIcon="left" statusBar title="骑手账号修改" fixed></uni-nav-bar>
    	
		<view class="formDataBox">
			<uni-forms :modelValue="formData"  label-position="top" label-width	="300" >
				<uni-forms-item label="骑手端账号" name="name">
					<uni-easyinput type="text" v-model="formData.rider_phone" placeholder="请输入优惠券名称,例如:端午节满30减15优惠券" :primaryColor="style.color" />
				</uni-forms-item>
				<uni-forms-item label="骑手端密码" name="name">
					<uni-easyinput type="text" v-model="formData.rider_pwd" placeholder="请输入优惠券名称,例如:端午节满30减15优惠券" :primaryColor="style.color" />
				</uni-forms-item>
			</uni-forms>
			<view class="submit" :style="{
				background: style.color
			}" @click="submit">
				保存
			</view>
		</view>
	</div>
</template>

<script>
import uninavbar2 from '../../components/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue';
import uninavbar3 from '../../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue';
import uninavbar4 from '../../components/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
import uninavbar5 from '../../components/uni-forms/components/uni-forms/uni-forms.vue';
import uninavbar6 from '../../components/uni-forms/components/uni-forms-item/uni-forms-item.vue';
import uninavbar7 from '../../components/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue';
import main from "@/middleware/main"
export default {
  components: {
    "uni-data-checkbox": uninavbar2,
    "uni-datetime-picker": uninavbar3,
    "uni-easyinput": uninavbar4,
    "uni-forms": uninavbar5,
    "uni-forms-item": uninavbar6,
  },
  components: {},
  data() {
    return {
		style: {
			color: "#ff6344"
		},
		formData: {
			rider_phone:"",
			rider_pwd:""
		},

	}
  },
  computed: {},
  methods: {
	submit(){
		this.request("Apprider/perfect",{
			...this.formData
		}).then(res=>{
			console.log(res);
			if (res.data.status==200) {
				this.tips.success(res.data.msg)
			}
		})
	}
  },
  watch: {},

  // 页面周期函数--监听页面加载
  	onLoad() {
		this.request('WechatUser/view', {
			s_id: uni.getStorageSync('schoolId')
		}).then(res => {
			console.log(res);
			const { rider_phone,rider_pwd}=res.data.data
			this.formData={
				rider_phone,
				rider_pwd
			}
		})
  	},
  // 页面周期函数--监听页面初次渲染完成
  onReady() {},
  // 页面周期函数--监听页面显示(not-nvue)
  onShow() {},
  // 页面周期函数--监听页面隐藏
  onHide() {},
  // 页面周期函数--监听页面卸载
  onUnload() {},
  // 页面处理函数--监听用户下拉动作
  // onPullDownRefresh() { uni.stopPullDownRefresh(); },
  // 页面处理函数--监听用户上拉触底
  // onReachBottom() {},
  // 页面处理函数--监听页面滚动(not-nvue)
  // onPageScroll(event) {},
  // 页面处理函数--用户点击右上角分享
  // onShareAppMessage(options) {},
}
</script>
<style lang="scss">
.formDataBox {
	width: 690rpx;
	padding: 30rpx;
	margin: 30rpx;
	background-color: #fff;
	border-radius: 30rpx;
}

.submit {
	width: 690rpx;
	margin: 30rpx 0;
	width: 630rpx;
	color: #fff;
	height: 80rpx;
	border-radius: 100rpx;
	font-size: 32rpx;
	display: flex;
	align-items: center;
	justify-content: center;
}

.uni-datetime-picker--btn,
.uni-calendar-item__weeks-box .uni-calendar-item--checked,
.uni-calendar-item--multiple .uni-calendar-item--before-checked,
.uni-calendar-item--multiple .uni-calendar-item--after-checked {
	background-color: $main_color !important;
}

.uni-datetime-picker-btn-text {
	color: $main_color !important;
}


</style>